#pragma once
#ifndef _SCENECOORDSPACEINFO_H
#define _SCENECOORDSPACEINFO_H

#include <Windows.h>
#include <gl/glut.h>
#include "FileStreamExtension.hpp"
#include "_3D_Vector.h"
#include "Array.hpp"


#define PI 3.1415926
#define Position3f _3D_Vector
#define Rotation3f _3D_Vector

using namespace std;


class SceneCoordSpaceInfo;

FileStreamOut& operator<< (FileStreamOut& output, const SceneCoordSpaceInfo& data);
FileStreamIn& operator>> (FileStreamIn& input, SceneCoordSpaceInfo& data);


class SceneCoordSpaceInfo
{
private:

  // Position
  Position3f _position;

  // Rotation
  Rotation3f _rotation;

  // Scale
  float _scale;

  float _width;
  float _height;

  void start_draw ();
  void end_draw ();

  void draw_sector (float x, float y, float r,
                    float endDegree = 360, float startDegree = 0);
  void draw_circle (float x, float y, float r);

public:

  // width and height is the Scene's size
  SceneCoordSpaceInfo (float width, float height);
  SceneCoordSpaceInfo (FileStreamIn& input);

  void adjust_pos (float dx, float dy, float dz);
  void adjust_angle (float dx, float dy, float dz);
  void transform ();
  void show_calibration_point (int pointIndex, OUT Array< float >& pointStore);
  void show_calibration_process (int pointIndex, float percent);
  void show_border ();
  void show_point (float x, float y);

  friend FileStreamOut& operator<< (FileStreamOut& output, const SceneCoordSpaceInfo& data);
  friend FileStreamIn& operator>> (FileStreamIn& input, SceneCoordSpaceInfo& data);
};

#endif